﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;

namespace TestApp
{
	class ValidUriRule : ValidationRule
	{
		public override ValidationResult Validate(object value, System.Globalization.CultureInfo cultureInfo)
		{
			try
			{
				var uri = new Uri(value.ToString());
				return ValidationResult.ValidResult;
			}
			catch (UriFormatException ex)
			{
				return new ValidationResult(false, ex.Message);
			}
		}
	}
}
